$(function () {
    $('.public-items').click(function () {
        $('.public-item').addClass('dis-none').eq($(this).index()).removeClass('dis-none');
        $('.public-items').hide();
    });

    // var $height = $('.public-item:not(.dis-none)').find('.public-content').height();
    var $height = 0;
    $('.btn-back').toggle(function () {
        $height = $('.public-item:not(.dis-none)').find('.public-content').height();
        $(this).parent('.public-header').siblings('.public-content').animate({height: "0px"}, 500);
        $(this).find('.icon-back').css("transform","rotateZ(180deg)");
    }, function () {
        $(this).parent('.public-header').siblings('.public-content').animate({height: $height + "px"}, 500);
        $(this).find('.icon-back').css("transform","rotateZ(0deg)");
    });

    $('.bus-line').click(function () {
       $('.public-all').hide();
       $('.public-one').show();
       $('.public-item:not(.dis-none)').find('.public-content').css("height", "auto");
    });

    $('.bike-item').click(function () {
        $('.bike-panel').show();
        $('.result-item').css("backgroundColor", "#fff").find('.icon-num').removeClass('icon-blue').addClass('icon-red');
        $(this).css("backgroundColor", "rgba(31, 139, 215, 0.1)").find('.icon-num').removeClass('icon-red').addClass('icon-blue');
    });

    $('.ting-item').click(function () {
        $('.ting-panel').show();
        $('.result-item').css("backgroundColor", "#fff").find('.icon-num').removeClass('icon-blue').addClass('icon-red');
        $(this).css("backgroundColor", "rgba(31, 139, 215, 0.1)").find('.icon-num').removeClass('icon-red').addClass('icon-blue');
    });
});